package com.wang.controller;

import com.wang.pojo.Husband;
import com.wang.pojo.User;
import com.wang.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class UserController {

    @Test
    public void userList(){
        ApplicationContext context=new ClassPathXmlApplicationContext("application.xml");

        UserService userServiceImpl = context.getBean("userServiceImpl", UserService.class);
        List<User> userList = userServiceImpl.userList();

        System.out.println(userList);

    }

    @Test
    public void husbandList(){
        ApplicationContext context=new ClassPathXmlApplicationContext("application.xml");

        UserService userServiceImpl = context.getBean("userServiceImpl", UserService.class);
        List<Husband> husbands = userServiceImpl.husbandList();

        System.out.println(husbands);

    }


}
